package com.ay201.oa.biz.workflow.impl;

import java.util.List;

import com.ay201.oa.biz.workflow.WorkFlowBiz;
import com.ay201.oa.commons.BaseDao;
import com.ay201.oa.dao.workflow.WorkFlowDao;
import com.ay201.oa.entity.workflow.WorkFlow;
import com.ay201.oa.entity.workflow.WorkFlowStep;

public class WorkFlowBizImpl implements WorkFlowBiz {
	private WorkFlowDao workFlowDao;
	
	public WorkFlowDao getWorkFlowDao() {
		return workFlowDao;
	}
	
	public void setWorkFlowDao(WorkFlowDao workFlowDao) {
		this.workFlowDao = workFlowDao;
	}
	
	/**
	 * @see {@link BaseDao}{@link #doSave(WorkFlow)}
	 */
	public void doSave(WorkFlow workFlow) {
		workFlowDao.create(workFlow);
	}
	
	/**
	 *@see WorkFlowDao#findWorkFlowStepsByWorkFlowId(int) 
	 */
	public List<WorkFlowStep> findWorkFlowStepsByWorkFlowId(int id) {
		
		return workFlowDao.findWorkFlowStepsByWorkFlowId(id);
	}
	/**
	 * @see {@link WorkFlowDao}{@link #doUpdate(WorkFlow)}
	 */
	public void doUpdate(WorkFlow workflow) {
		WorkFlow workflowTemp=workFlowDao.findById(workflow.getId());
		workflowTemp.setWorkflowStepList(workflow.getWorkflowStepList());
	}
}
